package com.tang.model.memorandum;

import lombok.ToString;

import java.util.List;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/5 13:50
 * @Desc
 */
@ToString
public class Editor {
    private String title;
    private String content;
    private List<String> photos;

    public void setTitle(String title) {
        this.title = title;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setPhotos(List<String> photos) {
        this.photos = photos;
    }

    public AriticleMemorandum saveToMemorandum() {
        AriticleMemorandum ariticleMemorandum = new AriticleMemorandum();
        ariticleMemorandum.setTitle(this.title);
        ariticleMemorandum.setContent(this.content);
        ariticleMemorandum.setPhotos(this.photos);
        return ariticleMemorandum;
    }

    public void undo(AriticleMemorandum ariticleMemorandum) {
        this.title = ariticleMemorandum.getTitle();
        this.content = ariticleMemorandum.getContent();
        this.photos = ariticleMemorandum.getPhotos();
    }

}
